package com.stox.client.embedded.screener;

import java.util.List;

import com.stox.client.api.screener.ScreenerClient;
import com.stox.services.screener.manager.ScreenerManager;
import com.stox.shared.core.beans.BeanDescriptor;
import com.stox.shared.core.util.DebugUtil;
import com.stox.shared.screener.model.ScreenBeanDescriptor;
import com.stox.shared.screener.model.ScreenerConfiguration;

public class EmbeddedScreenerClient implements ScreenerClient {
	
	public static final EmbeddedScreenerClient INSTANCE = new EmbeddedScreenerClient();
	
	private EmbeddedScreenerClient() {
		
	}
	
	@Override
	public List<ScreenBeanDescriptor> findAll() {
		DebugUtil.printStack();
		return ScreenerManager.INSTANCE.findAll();
	}

	@Override
	public void start(String scanId, ScreenerConfiguration screenerConfiguration, ScreenBeanDescriptor screenBeanDescriptor) {
		DebugUtil.printStack();
		ScreenerManager.INSTANCE.start(scanId, screenerConfiguration, screenBeanDescriptor);
	}

	@Override
	public void cancel(String scanId) {
		ScreenerManager.INSTANCE.cancel(scanId);
	}
	
	@Override
	public double completionPercentage(String scanId) {
		return ScreenerManager.INSTANCE.completionPercentage(scanId);
	}
	
	@Override
	public List<BeanDescriptor> getMatches(String scanId) {
		return ScreenerManager.INSTANCE.getMatches(scanId);
	}

}
